﻿using Abp.Domain.Entities;
using System;

namespace Batman.Jianbei.Forum.Core.ChatRoom
{
    /// <summary>
    /// 消息历史记录
    /// </summary>
    public class MsgHis : Entity<string>
    {
        public string Uid { get; set; }

        /// <summary>
        /// 房间ID
        /// </summary>
        public string RoomId { get; set; }

        /// <summary>
        /// 匿名身份ID
        /// </summary>
        public string MaskId { get; set; }

        /// <summary>
        /// 匿名名称
        /// </summary>
        public string MaskName { get; set; }

        public MsgTypeEnum MsgType { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime CreateAt { get; set; }

        /// <summary>
        /// 不被继承
        /// </summary>
        public MsgHis()
        {
            this.CreateAt = DateTime.Now;
        }

        protected MsgHis(string uid, string roomId, Mask mask, MsgTypeEnum msgType) : this()
        {
            Uid = uid;
            RoomId = roomId;
            MaskId = mask.Id;
            MaskName = mask.Nickname;
            MsgType = msgType;
        }
    }
}
